package com.mybatis;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class StringTypeHandle implements TypeHandler<String> {

    @Override
    public void setParameter(PreparedStatement prepareStatement, int index, String parameterValue) {
        try {
            prepareStatement.setString(index, parameterValue);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public String getResult(ResultSet rs, String colum) throws SQLException {
        return rs.getString(colum);
    }
}
